import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path:"/",
    redirect:"/home"
  },
  {
    name:"Home",
    path:"/home",
    component:()=>import("@/views/home.vue"),
    children:[
      {
        path:"/home",
        redirect:"/home/home-main"
      },
      {
        path:"home-main",
        component:()=>import("@/views/home-main.vue"),
        children:[
          {
            path:"/home/home-main",
            redirect:"/home/home-main/recommend"
          },
          {
            path:"recommend",
            component:()=>import("@/pages/home-recommend.vue")
          },
          {
            path:"talk",
            component:()=>import("@/pages/home-talk.vue")
          },
          {
            path:"follow",
            component:()=>import("@/pages/home-follow.vue")
          },
          {
            path:"request",
            component:()=>import("@/pages/home-request.vue")
          },
        ]
      },
      {
        path:"find",
        component:()=>import("@/views/find.vue"),
      },
      {
        path:"message",
        component:()=>import("@/views/message.vue"),
        children:[
          {
            path:"/home/message",
            redirect :"/home/message/comment"
          },
          {
            path:"comment",
            component:()=>import("@/pages/message-comment.vue")
          },
          {
            path:"callme",
            component:()=>import("@/pages/message-callme.vue")
          },
          {
            path:"notice",
            component:()=>import("@/pages/message-notice.vue")
          },
          {
            path:"dialogue",
            component:()=>import("@/pages/message-dialogue.vue")
          },
        ]
      },
      {
        path:"my",
        component:()=>import("@/views/my.vue"),
      },
      {
        path:"my-unlogin",
        component:()=>import("@/views/my-unlogin.vue"),
      },
    ]
  },
  {
    name:"More",
    path:'/more',
    component:()=>import("@/pages/more-hot.vue")
  },
  {
    name:"FindSearch",
    path:'/findSearch',
    component:()=>import("@/pages/find-search.vue")
  },
  {
    name:"FindResult",
    path:'/findResult',
    component:()=>import("@/pages/find-result.vue")
  },
  {
    name:"Setting",
    path:"/setting",
    component:()=>import("@/pages/my-setting.vue")
  },
  {
    name:"myLike",
    path:"/myLike",
    component:()=>import("@/pages/my-like.vue")
  },
  {
    name:"myCollect",
    path:"/myCollect",
    component:()=>import("@/pages/my-collect.vue")
  },
  {
    name:"myCreate",
    path:"/myCreate",
    component:()=>import("@/pages/my-create.vue")
  },
  {
    name:"Login",
    path:"/login",
    component:()=>import("@/views/login.vue"),
    children:[
      {
        path:"/login",
        redirect:"/login/login-pass"
      },
      {
        path:"login-phone",
        component:()=>import("@/pages/login-phone.vue")
      },
      {
        path:"login-pass",
        component:()=>import("@/pages/login-pass.vue")
      },
    ]
  },
  {
    name:"SendEntry",
    path:"/sendEntry",
    component:()=>import("@/pages/send-entry.vue"),
  },
  {
    name:"Preview",
    path:"/preview",
    component:()=>import("@/pages/send-preview.vue")
  },
  {
    name:"SendSuccess",
    path:"/sendSuccess",
    component:()=>import("@/pages/send-success.vue")
  },
  {
    name:"EditSuccess",
    path:"/editSuccess",
    component:()=>import("@/pages/edit-success.vue")
  },
  {
    name:"DetailEntry",
    path:"/detailEntry/id/:id/:time",
    component:()=>import("@/pages/detail-entry.vue")
  }
 
]

const router = new VueRouter({
  routes,
})
export default router
